package cn.mistorange.service;

import cn.mistorange.mapper.BillMapper;
import cn.mistorange.pojo.Bill;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class BillServiceImpl implements BillService{

    @Autowired
    public BillMapper billMapper;

    //新增
    @Override
    public void addBill(Bill bill) {
        billMapper.addBill(bill);
    }

    //查询
    @Override
    public Bill getBillById(Integer id) {
        return billMapper.findBillById(id);
    }


    //删除
    @Override
    public void deleteBill(Integer id) {
        billMapper.deleteBill(id);
    }

    //更新
    @Override
    public void updateBill(Bill bill) {
        billMapper.updateBill(bill);
    }

    //查询所有
    @Override
    public List<Bill> getAllBills() {
        return billMapper.findAllBills();
    }
}
